package cc.customer.web.myCustomer;

import cc.customer.Conversation.ConversationService;
import cc.customer.aiEmport.damain.CAiEmp;
import cc.customer.aiEmport.services.AiEmpServices;
import cc.customer.authorization.annotation.CurrentUser;
import cc.customer.bigEmport.damain.BigEmp;
import cc.customer.bigEmport.services.BigEmpServices;
import cc.customer.cAppNews.CAppNewsService;
import cc.customer.common.annotation.Log;
import cc.customer.common.domain.QueryRequest;
import cc.customer.common.domain.ResponseBo;
import cc.customer.common.utils.Constant;
import cc.customer.common.utils.DateUtil;
import cc.customer.common.utils.Utils;
import cc.customer.cusDynamic.domain.CusDynamic;
import cc.customer.cusDynamic.services.CusDynamicService;
import cc.customer.diaRecord.services.CdyDiaRecordServices;
import cc.customer.expCustomer.domain.ExEmp;
import cc.customer.expCustomer.services.ExEmpServices;
import cc.customer.myCustomer.damain.CusResource;
import cc.customer.myCustomer.damain.MyCustomer;
import cc.customer.myCustomer.damain.MyCustomerGroup;
import cc.customer.myCustomer.services.MyCustomerGroupService;
import cc.customer.myCustomer.services.MyCustomerService;
import cc.customer.myCustomer.services.PerSonServices;
import cc.customer.onschool.domain.OnSchoolResource;
import cc.customer.onschool.services.OnSchoolService;
import cc.customer.rabbit.domain.CAppNews;
import cc.customer.system.domain.MyUser;
import cc.customer.system.domain.SaleStage;
import cc.customer.system.service.DeptService;
import cc.customer.system.service.SaleService;
import cc.customer.system.service.SaleTagService;
import cc.customer.system.service.UserService;
import cc.customer.web.base.BaseController;
import com.alibaba.fastjson.JSONArray;
import org.apache.commons.lang3.StringUtils;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import java.util.*;

/**
 * @MethodName: $
 * @Description: TODO
 * @Param: $
 * @Return: $
 * @Author: cunfeng
 * @Date: 2020/6/9 11:03
 **/
@Controller
@RequestMapping("/app/customer")
public class MyCustomerController  extends BaseController {


    private Logger logger = LoggerFactory.getLogger(MyCustomerController.class);

    @Autowired
    private MyCustomerGroupService mgService;

    @Autowired
    private MyCustomerService myCustomerService;
    @Autowired
    private CAppNewsService cAppNewsService;

    @Autowired
    private SaleTagService saleTagService;


    @Autowired
    private UserService userService;

    @Autowired
    private SaleService salseService;

    @Autowired
    private PerSonServices perSonServices;


    @Autowired
    private DeptService deptService;

    @Autowired
    private ExEmpServices exEmpServices;

    @Autowired
    private CusDynamicService cusDynamicService;

    @Autowired
    private ConversationService converService;
    @Autowired
    private BigEmpServices bigEmpServicesOmp;

    @Autowired
    private AiEmpServices aiEmpServices;



    @Autowired
    private OnSchoolService onSchoolService;


    /**
     * 客户详情
     */


    @RequestMapping(value = "/getTypedetails")
    @ResponseBody
    public Map<String,Object> getMyCustomerList(Integer Type,String ids,CusDynamic dynamic,@CurrentUser MyUser user){
        Map<String,Object> map = new HashMap<String,Object>();
        String userid = user.getUserUuid();
        ResponseBo genjin = cusDynamicService.appGetDetailFollow(dynamic,userid);
        List<SaleStage> saleStages = salseService.selectAll();

            map.put("jieduan",saleStages);

        if(0 == Integer.parseInt(genjin.get("code").toString())){
            map.put("genjin",genjin.get("data"));
        }else{
            map.put("genjin",new ArrayList<>());
        }

        if(Type==1){
            //推广资源客户详情 标签
            ResponseBo tuiguang = exEmpServices.appGetExEmpDetail(ids, user);
            ResponseBo tuiguangB = exEmpServices.getExEmpDetailLabel(ids);


                if(0 == Integer.parseInt(tuiguang.get("code").toString())){
                    map.put("data",tuiguang.get("msg"));
                    map.put("code",0);
                }else{
                    map.put("code",500);
                    map.put("data",new ExEmp());
                }
                if(0 == Integer.parseInt(tuiguangB.get("code").toString())){
                    map.put("lable",tuiguangB.get("msg"));
                }else {
                    map.put("lable",new ExEmp());
                }
        }else if(Type==2){
            //网校资源客户详情 标签
            ResponseBo school = onSchoolService.AppFindCustomerDetailByid(ids,user);
            ResponseBo schoolb =   onSchoolService.selectOnshoolLabel(ids);
                if(0 == Integer.parseInt(school.get("code").toString())){
                    map.put("data",school.get("msg"));
                    map.put("code",0);
                }else{
                    map.put("code",500);
                    map.put("data",new OnSchoolResource());
                }
                if(0 == Integer.parseInt(schoolb.get("code").toString())){
                    map.put("lable",schoolb.get("msg"));
                }else {
                    map.put("lable",new OnSchoolResource());
                }
        }else if(Type==3){
            //大资源客户详情 标签
            ResponseBo big =bigEmpServicesOmp.AppfindAllBigEmpInfoById(ids,user);
            ResponseBo bigb = bigEmpServicesOmp.selectBigEmpLabel(ids);

                if(0 == Integer.parseInt(big.get("code").toString())){
                    map.put("data",big.get("msg"));
                    map.put("code",0);

                }else{
                    map.put("code",500);
                    map.put("data",new BigEmp());
                }
                if(0 == Integer.parseInt(bigb.get("code").toString())){
                    map.put("lable",bigb.get("data"));
                }else {
                    map.put("lable",new BigEmp());
                }
        }else if(Type == 4){
            //个人资源客户详情 标签
            ResponseBo me = perSonServices.appSelectMyCusDetail(ids, user);
            ResponseBo meb = perSonServices.selectMyCuatomerLabel(ids);
                if(0 == Integer.parseInt(me.get("code").toString())){
                    map.put("data",me.get("data"));
                    map.put("code",0);
                }else{
                    map.put("code",500);
                    map.put("data",new MyCustomer());
                }
                if(0 == Integer.parseInt(meb.get("code").toString())){
                    map.put("lable",meb.get("data"));
                }else {
                    map.put("lable",new MyCustomer());
                }

        }else if(Type == 5){
            //AI资源客户详情 标签

            ResponseBo AI = aiEmpServices.appFindAllAiEmpInfoById(ids,user);
            ResponseBo AIB = aiEmpServices.selectAiEmpLabel(ids);
            if(0 == Integer.parseInt(AI.get("code").toString())){
                map.put("data",AI.get("msg"));
                map.put("code",0);
            }else{
                map.put("code",500);
                map.put("data",new CAiEmp());
            }
            if(0 == Integer.parseInt(AIB.get("code").toString())){
                map.put("lable",AIB.get("msg"));
            }else {
                map.put("lable",new CAiEmp());
            }

        }
        return map;
    }

    /**
     * 更新客户详情
     * @param Type
     * @param exEmp
     * @param resource
     * @param customer
     * @param emp
     * @param aiEmp
     * @param user
     * @return
     */
    @RequestMapping(value = "/updateTypedetails")
    @ResponseBody
    public ResponseBo updateTypedetails(Integer Type , ExEmp exEmp,OnSchoolResource resource, MyCustomer customer,  BigEmp emp,CAiEmp aiEmp,@CurrentUser MyUser user){


        if(Type == 1){
            //推广资源
            exEmp.setcExRecent(user.getNickname()+Constant.GENZONG_RECORD_ZILAO);
            exEmp.setcExRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
            return this.exEmpServices.updateExEmpInfo(exEmp,user);
        }else if(Type == 2){
            //网校
            return onSchoolService.updateOnshoolEmpInfoByBpId(resource,user);
        }else if(Type == 3){
            //大资源
                emp.setBpRecent(user.getNickname()+Constant.GENZONG_RECORD_ZILAO);
                emp.setBpRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
                return bigEmpServicesOmp.updateBigEmpInfoByBpId(emp,user);
        }else if(Type == 4){
            //个人资源
            String uuid = customer.getMyCusId()+"";
            if(StringUtils.isEmpty(uuid)){
                return ResponseBo.error("数据加载失败");
            }
            String username= user.getNickname();
            customer.setMuRecent(username+ Constant.GENZONG_RECORD_ZILAO);
            customer.setMyRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
            return perSonServices.updateMyCusDetail(customer,user);
        }else if(Type == 5){
            //AI资源
             aiEmp.setAiRecent(user.getNickname()+Constant.GENZONG_RECORD_ZILAO);
             aiEmp.setAiRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
                return aiEmpServices.changeAiEmpInfo(aiEmp,user);
        }

        return ResponseBo.error("系统错误");
    }







    /**我的客户移动分组**/
    @RequestMapping("/moveCusGroup")
    @ResponseBody
    @Log("移动分组")
    public ResponseBo moveCusGroup(CusResource cusResource,@CurrentUser MyUser user){
        return myCustomerService.moveCusGroup(cusResource);
    }

















    /**我的客户列表*/
    @RequestMapping(value = "/getMyCustomerList")
    @ResponseBody
    public Map<String,Object> getMyCustomerList(CusResource cusResource, QueryRequest request,@CurrentUser MyUser user){
        String userid = user.getUserUuid();
        String deptid = user.getDeptId().toString();
        cusResource.setUserid(userid);
        cusResource.setDeptid(deptid);
        return super.selectByPageNumSizeOrderBy(request, () -> this.myCustomerService.selectMyCustomer(cusResource,user));
    }


    /**我的客户添加跟进**/
    @RequestMapping("/addFollow")
    @ResponseBody
    @Log("添加跟进")
    public ResponseBo addFollow(CusDynamic dynamic,@CurrentUser MyUser user){
        String userid = user.getUserUuid();
        return cusDynamicService.addAppFollow(dynamic,userid);
    }


    /**初始化分组列表**/
    @RequestMapping(value="selectGroupList")
    @ResponseBody
    public ResponseBo selectGroupList(@CurrentUser MyUser user){
        MyCustomerGroup group = new MyCustomerGroup();
        String userid = user.getUserUuid();
        group.setcGroupUserid(userid);
        List<MyCustomerGroup> list = mgService.selectAllGroup(group);
        return ResponseBo.ok("success",list);
    }

    /**获取标签得信息**/
    @RequestMapping(value="selectSaletag")
    @ResponseBody
    public ResponseBo selectSaletag(@CurrentUser MyUser user){
        try {
            JSONArray json  = saleTagService.getAllTag();
            return ResponseBo.ok(json);
        }catch (Exception e){
            logger.info(e.getMessage());
            return ResponseBo.error("获取失败，请稍后再试");
        }
    }

     /**获取客户阶段列表**/
    @RequestMapping("initTrackTable")
    @ResponseBody
    public ResponseBo initTrackTab(@CurrentUser MyUser user){
        List<SaleStage> list = salseService.selectAll();
        return ResponseBo.ok("success",list);
    }


    /**获取部门和人员得 树状图**/
    @RequestMapping("getUseeAndDepttree")
    @ResponseBody
    public  ResponseBo getUseeAndDepttree(@CurrentUser MyUser user){
        JSONArray json = deptService.getDeptAndUserTree();
        return ResponseBo.ok(json);
    }

    /**新增我的客户*/
    @RequestMapping(value="addMyCustomer")
    @ResponseBody
    public ResponseBo addMyCustomer(MyCustomer customer,@CurrentUser MyUser user){
        try {
            String userid = user.getUserUuid();
            String deptid = user.getDeptId()+"";
            String uuid = Utils.getUUID();
            customer.setMyCusCreatetime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
            customer.setMyCusCreator(userid);
            customer.setMyCusUuid(uuid);
            customer.setMyCusReceiver(userid);
            customer.setMyCusStage("1");
            customer.setMyCusIsdelete("0");
            customer.setMyCusDept(deptid);
            customer.setMuRecent(user.getNickname()+"录入了新的客户");
            customer.setMyRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
            return perSonServices.addMyCustomer(customer);
        }catch (Exception e){
            e.printStackTrace();
            return ResponseBo.error("新增失败");
        }
    }


    /**转让客户**/
    @RequestMapping(value="/companyMyCustomerTransfer")
    @ResponseBody
    @Log("转让客户")
    public ResponseBo companyMyCustomerTransfer(CusResource cusResource,String names,@CurrentUser MyUser user){
        String userid = user.getUserUuid();
        ResponseBo responseBo = myCustomerService.MyAppCustomerTransfer(cusResource, userid);
        //客户uuid
        List<String> uuidids = Arrays.asList(cusResource.getUuid().split(","));
        //客户资源类型
        List<String> typeids = Arrays.asList(cusResource.getTypes().split(","));
        //客户id
        List<String> ids = Arrays.asList((cusResource.getIds()+"").split(","));
        //客户名称
        List<String> name = Arrays.asList((names).split(","));
        //转让用户
        CAppNews cAppNews = new CAppNews();
        CAppNews cAppNews1 = new CAppNews();
        if(0 == Integer.parseInt(responseBo.get("code").toString())){
          /*  for(int t = 0;t < typeids.size();t++){
                MyUser user1 = userService.findUserByUuids(cusResource.getReceiver());
                String  typeid = typeids.get(t);

                cAppNews.setcCousrsType(typeids.get(t));
                cAppNews.setCusid(ids.get(t));
                cAppNews.setCustomerid(uuidids.get(t));
                cAppNews.setCustomername(name.get(t));
                cAppNews.setcConvNtype("2");
                cAppNews.setcConvType("1");
                cAppNews.setcSenderUser(user.getNickname());
                cAppNews.setcConvUsersName(user1.getNickname());
                cAppNews.setcConvUsers(user1.getUserUuid());
                cAppNews.setcConvTitle("客户转让");
                cAppNews.setcSenderUuid(user.getUserUuid());
                cAppNews.setcConvCont("有同事给你转让了1条客户资源");
                cAppNewsService.addCAppNews(cAppNews);


            }*/
            return ResponseBo.ok("转让成功");
        }

        return ResponseBo.error("转让失败");

    }


    /**批量设置客户得标签**/
    @RequestMapping(value="/setLabelMyCustomer")
    @ResponseBody
    @Log("批量设置标签")
    public ResponseBo setLabelMyCustomer(CusResource cusResource,String pid,String idstr,String uuid,@CurrentUser MyUser user){
        String userid = user.getUserUuid();
        try {
            return myCustomerService.myCustomerLabel(cusResource,pid,idstr,userid);
        }catch (Exception e){
            e.printStackTrace();
        }
        return ResponseBo.error();
    }


    /**修改网校客户得基本信息**/
    @RequestMapping(value = "/OnschoolEditinfo")
    @ResponseBody
    public ResponseBo bigempEditinfo(OnSchoolResource resource,@CurrentUser MyUser user){
        return onSchoolService.updateOnshoolEmpInfoByBpId(resource,user);
    }
    /**放弃我的客户*/
    @RequestMapping(value="/giveUpMyCus")
    @ResponseBody
    @Log("放弃客户")
    public ResponseBo delMyCustomer(String keys,String types,String names,@CurrentUser MyUser user){
        String userid = user.getUserUuid();
        ResponseBo responseBo = myCustomerService.giveUpMyCustomer(keys, types, userid, names);
        //客户uuid
        // List<String> uuidids = Arrays.asList(keys.split(","));
        //客户资源类型
        List<String> typeids = Arrays.asList(types.split(","));
        //客户id
        List<String> ids = Arrays.asList((keys+"").split(","));
        //客户名称
        List<String> name = Arrays.asList((names).split(","));

        CAppNews cAppNews = new CAppNews();
        CAppNews cAppNews1 = new CAppNews();
        if(0 == Integer.parseInt(responseBo.get("code").toString())){
            for(int t = 0;t < typeids.size();t++){
                //MyUser user1 = userService.findUserByUuids(cusResource.getReceiver());
                String  typeid = typeids.get(t);
                cAppNews.setcCousrsType(typeids.get(t));
                cAppNews.setCusid(ids.get(t));
                //cAppNews.setCustomerid(ids.get(t));
                cAppNews.setCustomername(name.get(t));
                cAppNews.setcConvNtype("1");
                cAppNews.setcConvType("1");
                cAppNews.setcConvUsersName(user.getNickname());
                cAppNews.setcConvUsers(user.getUserUuid());
                cAppNews.setcConvTitle("放弃客户");
                cAppNews.setcConvCont(user.getNickname()+"放弃的客户为："+name.get(t));
                cAppNewsService.addCAppNews(cAppNews);

            }
            return ResponseBo.ok();
        }else{
            return ResponseBo.error();
        }
    }

    /**分享我的客户*/
    @RequestMapping(value="/shareMyCustomer")
    @ResponseBody
    @Log("分享客户")
    public ResponseBo shareMyCustomer(CusResource cusResource,String flag,String names,@CurrentUser MyUser user){
        String userid = user.getUserUuid();
        ResponseBo responseBo = myCustomerService.shareAppMyCustomer(cusResource, flag, userid, names);
        //客户uuid
        List<String> uuidids = Arrays.asList(cusResource.getUuid().split(","));
        //客户资源类型
        List<String> typeids = Arrays.asList(cusResource.getTypes().split(","));
        //客户id
        List<String> ids = Arrays.asList((cusResource.getIds()+"").split(","));
        //客户名称
        List<String> name = Arrays.asList((names).split(","));
        //分享用户
        List<String> sharcus = Arrays.asList((cusResource.getSharcus()).split(","));

        CAppNews cAppNews = new CAppNews();
        System.out.println( responseBo.get("code"));
        if(0 == Integer.parseInt(responseBo.get("code").toString())){
            for(int t = 0;t < typeids.size();t++){
                for(int i = 0;i < sharcus.size();i++) {
                    MyUser user1 = userService.findUserByUuids(sharcus.get(i));
                    String typeid = typeids.get(t);
                    cAppNews.setcCousrsType(typeids.get(t));
                    cAppNews.setCusid(ids.get(t));
                    cAppNews.setCustomerid(uuidids.get(t));
                    cAppNews.setCustomername(name.get(t));
                    cAppNews.setcConvNtype("4");
                    cAppNews.setcConvType("1");
                    cAppNews.setcSenderUser(user.getNickname());
                    cAppNews.setcConvUsersName(user1.getNickname());
                    cAppNews.setcConvUsers(user1.getUserUuid());
                    cAppNews.setcSenderUuid(user.getUserUuid());
                    cAppNews.setcConvTitle("客户共享");
                    cAppNews.setcConvCont("有同事给你共享了1个客户资源："+name.get(t) );
                    cAppNewsService.addCAppNews(cAppNews);
                }
            }
            return ResponseBo.ok("分享成功");
        }

        return ResponseBo.error("分享失败");



    }


    /**修改推广客户资料**/
    @RequestMapping(value = "/updateExEmpDetail")
    @ResponseBody
    public ResponseBo updateExEmpDetail(ExEmp exEmp,@CurrentUser MyUser user){
        exEmp.setcExRecent(user.getNickname()+Constant.GENZONG_RECORD_ZILAO);
        exEmp.setcExRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
        return this.exEmpServices.updateExEmpInfo(exEmp,user);
    }

    /**修改个人客户详情*/
    @RequestMapping(value="updateCusDetail")
    @ResponseBody
    public ResponseBo updateCusDetail(MyCustomer customer,@CurrentUser MyUser user){
        String uuid = customer.getMyCusId()+"";
        if(StringUtils.isEmpty(uuid)){
            return ResponseBo.error("数据加载失败");
        }
        String username= user.getNickname();
        customer.setMuRecent(username+ Constant.GENZONG_RECORD_ZILAO);
        customer.setMyRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
        return perSonServices.updateMyCusDetail(customer,user);
    }


    /**加载客户详情*/
    @RequestMapping(value="getMyCustomerDetail")
    @ResponseBody
    public ResponseBo selectMyDetail( String myCusUuid,@CurrentUser MyUser user){
        String uuid = myCusUuid+"";
        if(StringUtils.isEmpty(uuid)){
            return ResponseBo.error("数据加载失败");
        }
        return perSonServices.appSelectMyCusDetail(myCusUuid,user);
    }

    /**获取推广客户资料**/
    @RequestMapping(value = "/getExEmpDetail")
    @ResponseBody
    public ResponseBo getExEmpDetail(String ids,@CurrentUser MyUser user){
        return this.exEmpServices.appGetExEmpDetail(ids,user);
    }
    /**获取推广客户的标签**/
    @RequestMapping(value = "/getExEmpDetailLabel")
    @ResponseBody
    public ResponseBo getExEmpDetailLabel(String ids){
        return this.exEmpServices.getExEmpDetailLabel(ids);
    }



    /**加载我的客户详情的标签*/
    @RequestMapping(value="selectMyCuatomerLabel")
    @ResponseBody
    public ResponseBo selectMyCuatomerLabel(String ids){
        return perSonServices.selectMyCuatomerLabel(ids);
    }


    /**查询网校客户的详情**/
    @RequestMapping("/viewOnschoolDetail")
    @ResponseBody
    public ResponseBo viewOnschoolDetail(String keyid,@CurrentUser MyUser user){

        return onSchoolService.AppFindCustomerDetailByid(keyid,user);
    }
    /**查询网校资源的 客户的标签**/
    @RequestMapping("/selectSeaOnschoolLabel")
    @ResponseBody
    public  ResponseBo selectSeaOnschoolLabel(String keyid){
        return onSchoolService.selectOnshoolLabel(keyid);
    }



    /**加载客户跟进详情**/
    @RequestMapping("/getDetailFollow")
    @ResponseBody
    public ResponseBo getDetailFollow(CusDynamic dynamic,@CurrentUser MyUser user){
        String userid = user.getUserUuid();
        return cusDynamicService.appGetDetailFollow(dynamic,userid);
    }


    /**修改大资源用户得基本信息**/
    @RequestMapping(value = "/bigempEditinfo")
    @ResponseBody
    public ResponseBo bigempEditinfo(BigEmp emp,@CurrentUser MyUser user){
        emp.setBpRecent(user.getNickname()+Constant.GENZONG_RECORD_ZILAO);
        emp.setBpRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
        return bigEmpServicesOmp.updateBigEmpInfoByBpId(emp,user);
    }
    /**查看大资源客户详情**/
    @RequestMapping("/viewBigEmpDetail")
    @ResponseBody
    public ResponseBo viewBigEmpDetail(String keyid,@CurrentUser MyUser user){
        return bigEmpServicesOmp.AppfindAllBigEmpInfoById(keyid,user);
    }

    /***
     * 大资源标签
     * @param keyid
     * @return
     */
    @RequestMapping("/getBigEmpDetailLabel")
    @ResponseBody
    public ResponseBo getBigEmpDetailLabel(String keyid){
        return bigEmpServicesOmp.selectBigEmpLabel(keyid);
    }
    /**修改AI用户得基本信息**/
    @RequestMapping(value = "/aiEmpEditinfo")
    @ResponseBody
    public ResponseBo bigempEditinfo(CAiEmp emp,@CurrentUser MyUser user){
        emp.setAiRecent(user.getNickname()+Constant.GENZONG_RECORD_ZILAO);
        emp.setAiRecentTime(DateUtil.getCurrentDate("yyyy-MM-dd HH:mm:ss"));
        return aiEmpServices.changeAiEmpInfo(emp,user);
    }

    /**查询ai标签**/
    @RequestMapping("/getAiEmpDetailLabel")
    @ResponseBody
    public ResponseBo getAiEmpDetailLabel(String keyid){
        return aiEmpServices.selectAiEmpLabel(keyid);
    }


    /**查询AI客户的详情**/
    @RequestMapping("/viewAiEmpDetail")
    @ResponseBody
    public ResponseBo viewAiEmpDetail(String keyid,@CurrentUser MyUser user){
        return aiEmpServices.appFindAllAiEmpInfoById(keyid,user);
    }






}
